package com.example.lotterysystem.service.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Created with IntelliJ IDEA.
 * Description: 用户的身份标识信息
 * User: Spider-Man
 * Date: 2025-09-05
 * Time: 15:27
 */
@Getter
@AllArgsConstructor
public enum UserIdentityEnum {

    //所有枚举类都包含一个name()方法, 获取的是
    ADMIN("管理员"),
    NORMAL("普通用户");

    private final String message;


    public static UserIdentityEnum forName(String name) {
        for (UserIdentityEnum userIdentityEnum : UserIdentityEnum.values()) {
            if (userIdentityEnum.name().equalsIgnoreCase(name)) {
                return userIdentityEnum;
            }
        }
        return null;
    }

}
